/**
 * Oct 11, 2013 2:56:35 PM
 * com.kratonsolution.belian.security.impl.service
 * ServiceRegistry.java
 */
package com.kratonsolution.belian.security.impl.service;

import java.util.HashMap;
import java.util.Map;

import com.kratonsolution.belian.kernel.service.EService;
import com.kratonsolution.belian.security.api.dm.Access;

/**
 * @author Agung Dodi Perdana
 * @email agung.dodi.perdana@gmail.com
 * @Version Sinch 0.0.1
 */
public class Registry
{
    private final Map<EService,Access> registrys = new HashMap<EService, Access>();
    
    public void register(Access access)
    {
        EService service = EService.valueOf(access.getModuleCode());
        if(!registrys.containsKey(service))
            registrys.remove(service);

        registrys.put(service, access);
    }
    
    public Access get(EService service)
    {
        return registrys.get(service);
    }
}
